<template>
  <rx-layout>
    <div slot="center">
      <a-form-model ref="form">
        <a-form-model-item style="display: none">
          <a-input v-model="mdl.id"/>
        </a-form-model-item>
        <a-row>
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.archiveDate','归档日期')" prop="archiveDate">
              {{mdl.archiveDate}}
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.status','状态')" prop="memo">
              {{statusMap[mdl.status].text}}
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.startTime','开始时间')" prop="startTime">
              {{mdl.startTime}}
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.endTime','结束时间')" prop="endTime">
              {{mdl.endTime}}
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="24">
            <a-form-model-item :labelCol="labelCol1" :wrapperCol="wrapperCol1" :label="$ti18('rxForm.notes','备注')" prop="memo">
              {{mdl.memo}}
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row>
          <a-col :span="24">
            <a-form-model-item :labelCol="labelCol1" :wrapperCol="wrapperCol1" :label="i18n('form.errorLog','错误日志')" prop="errLog">
              {{mdl.errLog}}
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </div>
  </rx-layout>
</template>
<script>
  import BpmArchiveLogApi from '@/api/bpm/core/bpmArchiveLog'
  import {BaseFormModel, RxDialog} from '@lowcode/jpaas-common-lib';

  export default {
    name: 'BpmArchiveLogEdit',
    mixins: [BaseFormModel],
    components: {
      RxDialog,
    },
    props: ["id"],
    data() {
      return {
        mdl:{},
        statusMap: {
          "1": { text: this.i18n('statusMap.success','成功')},
          "0": { text: this.i18n('statusMap.fail','失败')}
        },
      }
    },
    created(){
      if(this.id){
        this.get(this.id);
      }
    },
    methods: {
        i18n(name,text,key){
            return this.$ti18(name,text,"bpmArchiveLog",key);
        },
      get(id) {
        BpmArchiveLogApi.get(id).then(res=>{
          this.mdl=res.data;
        });
      },
      save(values) {
        return BpmArchiveLogApi.save(values);
      }

    }
  }
</script>